<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        body {
            perspective: 500px;
        }
        .box    {
            position: relative;
            width: 300px;
            height: 300px;
            margin: 100px auto;
            transition: all 2s;
            transform-style: preserve-3d;
        }
        .box1,
        .box2 {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            line-height: 300PX;
            text-align: center;
            font-size: 30px;
            border-radius: 50%;
            color: #ce1cf1;
        }
        .box1 {
            background-color: purple;
        }
        .box2{
            background-color: pink;
            transform: rotateY(180deg);
        }
        .box:hover {
            transform: rotateY(180deg);
        }
    </style>
</head>
<body>
   
    <div class="box">
        <div class="box1">黑马</div>
        <div class="box2">欢迎你</div>
    </div>
</body>
</html>